package com.hyacinth.forumbite.controller;

import com.hyacinth.forumbite.common.AppResult;
import com.hyacinth.forumbite.exception.ApplicationException;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Yun
 * @Date: 2025/5/16
 */
@RestController
@RequestMapping("/test")
@Tag(name = "测试相关接口")
public class TestController {
    @GetMapping("/hello")
    public String hello () {
        return "hello, Spring boot...";
    }

    @GetMapping("/exception")
    public AppResult testException () throws Exception {
        throw new Exception("这是一个Exception...");
    }
    @GetMapping("/appException")
    public AppResult testApplicationException () {
        throw new ApplicationException("这是一个ApplicationException...");
    }
}
